package Demo;

public class Demo_2_Runnable {
    public static void main(String[] args) {
        MyRunnable runnable = new MyRunnable();
        Thread thread = new Thread(runnable);
        thread.start();
        MyThread mythread = new MyThread();
        mythread.start();

    }
}
class MyRunnable implements Runnable{
    @Override
    public void run() {
        while(true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("hello my runnable...");
        }
    }
}